package edu.jxut.reggie.server.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import edu.jxut.reggie.mapper.CategoryMapper;
import edu.jxut.reggie.pojos.Category;
import edu.jxut.reggie.server.CategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class CategoryServiceImpl extends ServiceImpl<CategoryMapper, Category> implements CategoryService {
    @Autowired
    private CategoryMapper categoryMapper;

    @Override
    public Page<Category> queryByPage(Integer page, Integer pageSize) {
        Page<Category> categoryPage = new Page<>();
        categoryPage.setPages(page);
        categoryPage.setSize(pageSize);

        return categoryMapper.selectPage(categoryPage, null);
    }
}